import pypackager
import os,sys
p=pypackager.PyPackager("mytrips") #package name
if len(sys.argv) > 1:
	p.working_directory = os.path.abspath(sys.argv[1])
p.display_name = 'mytrips' #package display name in HAM
p.version = '0.1.0' #package version
p.buildversion == '1' #package build version
p.description="""my trips SYSTEM""" #package description
p.author='Nokia SPPI Team' #package author
p.maintainer='Nokia SPPI Team' #package maintainer
p.email='XXX@nokia.com' #package maintainer email
p.depends = "python2.5, python-hildondesktop, hildon-desktop-python-loader, python-location, python-dbus, python-simplejson, python-gobject,python-gtk2" #package dependancies
p.section="user/development" #package section
p.arch="armel" #package arch
p.urgency="low" #package urgency
p.distribution="fremantle" #package distribution
p.repository="extras-devel" #package repository
p.bugtracker = 'XXX@nokia.com' #bug tracker field (could be a link http://bugs.maemo.org)
p.preinstall = """#!/bin/sh
rm -f /opt/mytrips/*.pyo 
"""
#p.postinstall=""" #!/bin/sh
#chmod +x /usr/bin/sppicommute """ # A post install script to set +x flag
p.changelog ="""
  * First Fremantle Release
""" # the changelog
dir_name='src' #src directory name
#Here we will loop in all files, directory in src to add it to pkg
for root, dirs, files in os.walk(dir_name):
	real_dir = root[len(dir_name):]
	if ".svn" in real_dir:
		continue
	fake_file = []
	for f in files:
		fake_file.append(root + os.sep + f + "|" + f)
	if len(fake_file) > 0:
		p[real_dir] = fake_file
#Generate a package src
#print p.generate(build_binary=False,build_src=True)
#Generate a binary src
print p.generate(build_binary=True,build_src=False)
